package com.elock.service.serviceImpl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.elock.base.core.Page;
import com.elock.base.core.Pageable;
import com.elock.base.core.service.impl.BaseServiceImpl;
import com.elock.dao.TerminalMessageEventDao;
import com.elock.entity.TerminalMessageEvent;
import com.elock.service.SaleOrgBaseService;
import com.elock.service.TerminalMessageEventService;

/**
 * 终端事件信息
 * @author 仁德
 */
@Service("terminalMessageEventServiceImpl")
public class TerminalMessageEventServiceImpl extends BaseServiceImpl<TerminalMessageEvent>
		implements TerminalMessageEventService {

	@Resource(name = "terminalMessageEventDao")
	private TerminalMessageEventDao terminalMessageEventDao;
	@Resource(name = "saleOrgBaseServiceImpl")
	private SaleOrgBaseService saleOrgBaseService;

	@Override
	@Transactional(readOnly = true)
	public Page<Map<String, Object>> findPage(String elockids, String terminalids,
			Long lastId, String plateNum, String terminalNum, String elockNum,
			Long saleOrgId, String startTime, String endTime, Pageable pageable) {
		return terminalMessageEventDao.findPage(elockids,
				terminalids,
				lastId,
				plateNum,
				terminalNum,
				elockNum,
				saleOrgId,
				startTime,
				endTime,
				pageable);
	}

	@Override
	@Transactional(readOnly = true)
	public List<Map<String, Object>> findList(String elockids, String terminalids,
			Long lastId, Integer maxcount) {
		return terminalMessageEventDao.findList(elockids, terminalids, lastId, maxcount);
	}

	@Override
	@Transactional(readOnly = true)
	public List<Map<String, Object>> findListByTaskSn(String taskSn) {
		return terminalMessageEventDao.findListByTaskSn(taskSn);
	}

	@Override
	@Transactional(readOnly = true)
	public List<Map<String, Object>> getStatus(String carIds, String elockIds,
			String terminalIds) {
		return terminalMessageEventDao.getStatus(carIds, elockIds, terminalIds);
	}

	@Override
	@Transactional(readOnly = true)
	public Map<String, Object> getRealtimePosition(Long id, Integer type,
			String terminalNum) {
		return terminalMessageEventDao.getRealtimePosition(id, type, terminalNum);
	}

	@Override
	@Transactional(readOnly = true)
	public Page<Map<String, Object>> findCarMonitorPage(Integer type, Long oid,
			String carNumber, String startTime, String endTime, Pageable pageable) {
		return terminalMessageEventDao.findCarMonitorPage(type,
				oid,
				carNumber,
				startTime,
				endTime,
				pageable);
	}

	@Override
	@Transactional(readOnly = true)
	public Page<Map<String, Object>> findTerminalMonitorPage(Integer type, Long oid,
			String terminalNum, String startTime, String endTime, Pageable pageable) {
		return terminalMessageEventDao.findTerminalMonitorPage(type,
				oid,
				terminalNum,
				startTime,
				endTime,
				pageable);
	}

	@Override
	@Transactional(readOnly = true)
	public Integer countTerminalMessageEvent(String elockids, String terminalids,
			Long lastId, String plateNum, String terminalNum, String elockNum,
			Long saleOrgId, String startTime, String endTime, Pageable pageable,
			Integer page, Integer size) {
		return terminalMessageEventDao.countTerminalMessageEvent(elockids,
				terminalids,
				lastId,
				plateNum,
				terminalNum,
				elockNum,
				saleOrgId,
				startTime,
				endTime,
				pageable,
				page,
				size);
	}

	@Override
	@Transactional(readOnly = true)
	public List<Map<String, Object>> findTerminalMessageEventList(String elockids,
			String terminalids, Long lastId, String plateNum, String terminalNum,
			String elockNum, Long saleOrgId, String startTime, String endTime,
			Pageable pageable, Integer page, Integer size) {
		return terminalMessageEventDao.findTerminalMessageEventList(elockids,
				terminalids,
				lastId,
				plateNum,
				terminalNum,
				elockNum,
				saleOrgId,
				startTime,
				endTime,
				pageable,
				page,
				size);
	}
}
